GtkTreeviewColumn: don't focus-on-click header buttons
authorNelson Benítez León <nbenitezl@gmail.com>
Fri, 1 May 2020 02:59:08 +0000 (22:59 -0400)
committerNelson Benítez León <nbenitezl@gmail.com>
Fri, 1 May 2020 02:59:08 +0000 (22:59 -0400)
currently when mouse clicking on a column header
to sort it it is grabbing keyboard focus, this
should not happen, keyboard focus should remain
where it was before. This can be seen on the
GtkFileChooser widget, when having the keyboard
focus on the file list items and clicking on a
column header to sort it the keyboard focus is
now on the header.

gtk/gtktreeviewcolumn.c

index 75dface61caf5c087a3ed5689589b9b690bdef6c..59fca58b1695515a5b96b1e3f8dc79788c8511f6 100644 (file)
@@ -851,6 +851,7 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
 
   priv->button = gtk_button_new ();
   g_object_ref_sink (priv->button);
+  gtk_widget_set_focus_on_click (priv->button, FALSE);
 
   g_signal_connect (priv->button, "clicked",
                    G_CALLBACK (gtk_tree_view_column_button_clicked),